package panda.client.ui.widgets;

import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public class CombatZone extends Composite {
	private VerticalPanel shell;
	private Label stripe;

	int stripeHeight = 100;
	String color = "rgb(0, 128, 192)";

	public CombatZone() {
		stripe = new Label("");
		shell = new VerticalPanel();

		DOM.setStyleAttribute(shell.getElement(), "width", "100%");
		
		/* IE6 and IE7 don't display the right margin but firefox does. */
		DOM.setStyleAttribute(shell.getElement(), "marginLeft", Bin.canvasPadding + "px");
		DOM.setStyleAttribute(shell.getElement(), "marginRight", Bin.canvasPadding + "px");
		shell.add(stripe);

		DOM.setStyleAttribute(stripe.getElement(), "width", "100%");
		DOM.setStyleAttribute(stripe.getElement(), "height", stripeHeight + "px");
		DOM.setStyleAttribute(stripe.getElement(), "zIndex", "0");
		DOM.setStyleAttribute(stripe.getElement(), "backgroundColor", color);
		DOM.setStyleAttribute(stripe.getElement(), "filter", "alpha(opacity=10)");
		DOM.setStyleAttribute(stripe.getElement(), "opacity", "0.10");

		initWidget(shell);
	}

	public int getStripeHeight() {
		return stripeHeight;
	}
}